package demo3;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import java.rmi.ServerError;

@Component
public class Person {
    @Autowired//自动装配
    @Qualifier("winter")
    private Clothes clothes;
//    private Shirt shirt;//Person需要使用shirt时，将其定义为一个属性
//    private Sweater sweater;//毛衣
    public void play(){
//        Shirt shirt = new Shirt();
        clothes.wear();
//        shirt.wear();
        System.out.println("出去玩!");
    }
}
